//
//  HWHomeBannerItemCell.swift
//  HWanGame
//
//  Created by 王昌健 on 2021/12/27.
//  Copyright © 2021 94Wan. All rights reserved.
//

import UIKit

class HWHomeBannerItemCell: UICollectionViewCell {
    var itemView:HWHomeBannerItemView!
    
    var model:HWHomeGongNengModel? {
        didSet {
            itemView.nameLabel.text = model?.name
            itemView.imageView.sd_setImage(with: URL(string: model?.icon ?? ""), completed: nil)
        }
    }
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        initUI()
        
        initFrame()
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

extension HWHomeBannerItemCell {
    private func initUI() -> Void {
        contentView.backgroundColor = .clear
        
        itemView = HWHomeBannerItemView()
        contentView.addSubview(itemView)
        
    }
    
    private func initFrame() -> Void {
        itemView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
    }
}

